using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
    [Table("bgm_mas_strategy_mapping"), DataContract]
    public class MasStrategyMapping
    {
        public MasStrategyMapping()
        {
            this.StrategyDataMappings = new HashSet<StrategyDataMapping>();
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "BgmStratMapId", ResourceType = typeof(Resources.MasStrategyMappingResource))]
        [Column("bgm_strat_map_seq", TypeName="int")]
        public int BgmStratMapId { get; set; }

        [ForeignKey("BgmStratType")]
        [DataMember, Display(Name = "BgmStratTypeId", ResourceType = typeof(Resources.MasStrategyMappingResource))]
        [Column("bgm_strat_type_seq", TypeName="int")]
        public Nullable<int> BgmStratTypeId { get; set; }

        [ForeignKey("BgmStratVer")]
        [DataMember, Display(Name = "BgmStratVerId", ResourceType = typeof(Resources.MasStrategyMappingResource))]
        [Column("bgm_strat_ver_seq", TypeName="int")]
        public Nullable<int> BgmStratVerId { get; set; }

        [ForeignKey("UpperBgmStratMap")]
        [DataMember, Display(Name = "UpperBgmStratMapId", ResourceType = typeof(Resources.MasStrategyMappingResource))]
        [Column("upper_bgm_strat_map_seq", TypeName="int")]
        public Nullable<int> UpperBgmStratMapId { get; set; }

        [DataMember]
        public virtual ICollection<StrategyDataMapping> StrategyDataMappings { get; set; }

        [DataMember]
        public virtual MasStrategyType BgmMasStrategyType { get; set; }

        [DataMember]
        public virtual MasStrategyVersion BgmMasStrategyVersion { get; set; }

        [DataMember]
        public virtual MasStrategyType BgmStratType { get; set; }

        [DataMember]
        public virtual MasStrategyVersion BgmStratVer { get; set; }

        [DataMember]
        public virtual MasStrategyMapping UpperBgmStratMap { get; set; }



        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}